/* Copyright (C) 2021 Rain */

/* This file is part of XNIX. */

/* 
  XNIX is free software: you can redistribute it and/or modify 
  it under the terms of the GNU General Public License as published by 
  the Free Software Foundation, either version 3 of the License, or 
  (at your option) and later version. 
*/

/*
  XNIX is distributed in the hope that it will be useful, 
  but WITHOUT ANY WARRANTY; without even the implied warranty of 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
  GNU General Public License for more details. 
*/

/*
  You should have received a copy of the GNU General Public License 
   along with XNIX. If not, see <https://www.gnu.org/licenses/>.  
*/



#include <kernel/init.h>
#include <kernel/errno.h>
#include <kernel/types.h>


#define ATACMD_ID 	0xec

#define ATACMD_RD 	0x20
#define ATACMD_RD48 	0x24

#define ATACMD_WR 	0x30
#define ATACMD_WR48 	0x34

#define ATASTAT_READY 	0x40
#define ATASTAT_REQ 	0x08
#define ATASTAT_ERR 	0x01
#define ATASTAT_BUSY 	0x80

#define ATACTL_INTDIS 	0x02
#define ATACTL_RESET 	0x04

#define ATAERR_OTHER 	0x01
#define ATAERR_TRACK0	0x02
#define ATAERR_ABORT 	0x04
#define ATAERR_NOTFOUND	0x10
#define ATAERR_DATAERR 	0x40
#define ATAERR_BADSECT 	0x80

